package cn.shop.dys.bean;

/**
 * Created by jian on 2016/4/10.
 */
import com.lidroid.xutils.db.annotation.Id;
import com.lidroid.xutils.db.annotation.Table;

import cn.shop.lib_common.CommonUtil;

@Table(name ="tab_msg" )
public class Msg{
    @Id(column = "_id")
    public int id;
    public String jid;
    public String content;
    public int type;
    public String time;
    public int msgCount;
    public static final int CHAT_TYPE_OTHER=0;
    public static final int CHAT_TYPE_ME=1;

    public Msg() {
    }

    private Msg(String jid, String content, int type) {
        this.jid = jid;
        this.content = content;
        this.type =  type;
        this.time= CommonUtil.getCurrentTime();
    }

    @Override
    public String toString() {
        return "Msg{" +
                "id=" + id +
                ", jid='" + jid + '\'' +
                ", content='" + content + '\'' +
                ", type=" + type +
                ", time='" + time + '\'' +
                '}';
    }

    public static Msg creatMsg(String jid, String content, int type){
        return new Msg(jid,content,type);
    }
}
